<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ArNetworking: ArServerAdvertiser Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ArNetworking
   &#160;<span id="projectnumber">dev20180125</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArServerAdvertiser.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classArServerAdvertiser-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArServerAdvertiser Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Publish server information on local network for service discovery.  
 <a href="classArServerAdvertiser.html#details">More...</a></p>

<p><code>#include &lt;ArServerAdvertiser.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa7b95d336dea9f5252e331334887dc1d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArServerAdvertiser.html#aa7b95d336dea9f5252e331334887dc1d">ArServerAdvertiser</a> (<a class="el" href="classArServerBase.html">ArServerBase</a> *server, const char *name, const char *description, const char *servertype=NULL)</td></tr>
<tr class="separator:aa7b95d336dea9f5252e331334887dc1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12afaf656627ebe47f56f93bb2621db6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArServerAdvertiser.html#a12afaf656627ebe47f56f93bb2621db6">shutdown</a> ()</td></tr>
<tr class="separator:a12afaf656627ebe47f56f93bb2621db6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22b815056f0a17f000b1e0219c444d4f"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArServerAdvertiser.html#a22b815056f0a17f000b1e0219c444d4f">~ArServerAdvertiser</a> ()</td></tr>
<tr class="separator:a22b815056f0a17f000b1e0219c444d4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Publish server information on local network for service discovery. </p>
<p>On Linux, run the external <code>/usr/bin/avahi-publish</code> command to advertise this server using mDNS Service Discovery (mDNS-SD). The <code>avahi-publish</code> tool must be installed on the system (on Ubuntu, run <code>sudo apt-get install avahi-utils</code> to install). Use <code>avahi-browse _arnetworking._tcp</code> to search the mDNS system for ArNetworking services or install and run <code>avahi-discover</code> for a simple GUI listing of services.</p>
<p>On Windows, this class does nothing.</p>
<p>The external command is executed in a new process using vfork() when an instance of this object is instantiated. If this object is destroyed or <a class="el" href="classArServerAdvertiser.html#a12afaf656627ebe47f56f93bb2621db6">shutdown()</a> is called, or <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a6abc3d39b3e9548063bb8e78375acc17">Aria::exit()</a> is called, then the process is stopped (by sending it SIGKILL). Note: If you do not save the instance, the process will be killed immediately. Typical usage is to create an instance in <a class="el" href="changeMapOnServer_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main()</a> after running the server with <a class="el" href="classArServerBase.html#a93c742ddc58a8f035a0d1b9c1fae4599" title="Runs the server in its own thread. ">ArServerBase::runAsync()</a>.</p>
<p>Using this is optional and not neccesary to use ArNetworking, but it enables some convenience tools.</p>
<dl class="section note"><dt>Note</dt><dd>Available on Linux only</dd></dl>
<p>Example: </p><div class="fragment"><div class="line">...</div><div class="line">server.runAsync();</div><div class="line"><a class="code" href="classArServerAdvertiser.html">ArServerAdvertiser</a> adv(&amp;server, <span class="stringliteral">&quot;MyServer&quot;</span>, <span class="stringliteral">&quot;My special server&quot;</span>);</div><div class="line">...</div></div><!-- fragment --> <dl><dt><b>Examples: </b></dt><dd><a class="el" href="serverDemo_8cpp-example.html#_a94">serverDemo.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa7b95d336dea9f5252e331334887dc1d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ArServerAdvertiser::ArServerAdvertiser </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArServerBase.html">ArServerBase</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>description</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>servertype</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>References <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a5c4bfae6980dd3a7655a4cc7b32d1aa4">Aria::addExitCallback()</a>, <a class="el" href="classArServerBase.html#ad2baa7f9e5d3d62361084f458c9e1c0b">ArServerBase::getTcpPort()</a>, <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log()</a>, and <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a6e80d09c67dad73e9ba736e91ec893be">ArLog::Verbose</a>.</p>

</div>
</div>
<a class="anchor" id="a22b815056f0a17f000b1e0219c444d4f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual ArServerAdvertiser::~ArServerAdvertiser </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>References <a class="el" href="classArServerAdvertiser.html#a12afaf656627ebe47f56f93bb2621db6">shutdown()</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a12afaf656627ebe47f56f93bb2621db6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ArServerAdvertiser::shutdown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>References <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log()</a>, <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, and <a class="elRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a6e80d09c67dad73e9ba736e91ec893be">ArLog::Verbose</a>.</p>

<p>Referenced by <a class="el" href="classArServerAdvertiser.html#a22b815056f0a17f000b1e0219c444d4f">~ArServerAdvertiser()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="ArServerAdvertiser_8h.html">ArServerAdvertiser.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArServerAdvertiser.html">ArServerAdvertiser</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
